﻿<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span>
		系统管理
		<span class="c-gray en">&gt;</span>
		系统日志
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="Hui-article">
		<article class="cl pd-20">
			<form action="{:url('System/system_log')}" method="post">
				<div class="text-c"> 日期范围：
					<input type="text" onfocus="selecttime(1)" name="start_time" id="logmin" class="input-text Wdate" style="width:120px;">
					-
					<input type="text" onfocus="selecttime(2)" name="end_time" id="logmax" class="input-text Wdate" style="width:120px;">
					<input type="text" name="" id="" placeholder="日志名称" style="width:250px" class="input-text">
					<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜日志</button>
				</div>
			</form>
			<div class="cl pd-5 bg-1 bk-gray mt-20">
				<span class="l">
				<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
				</span>
			</div>
			<div class="mt-10">
				<table class="table table-border table-bordered table-bg table-hover table-sort">
					<thead>
						<tr class="text-c">
							<th width="25"><input type="checkbox" name="" value=""></th>
							<th width="80">ID</th>
							<th width="100">类型</th>
							<th>内容</th>
							<th width="17%">用户名</th>
							<th width="120">客户端IP</th>
							<th width="120">时间</th>
						</tr>
					</thead>
					<tbody>
						{volist name="system_log" id="va"}
							<tr class="text-c">
								<td><input type="checkbox" value="{$va.id}" name="id"></td>
								<td>{$va.id}</td>
								<td>{$va.type}</td>
								<td>{$va.op_bak}</td>
								<td>{$va.username}</td>
								<td>{$va.op_ip}</td>
								<td>{$va.op_time|date="Y-m-d H:i:s",###}</td>
							</tr>
						{/volist}
					</tbody>
				</table>
			</div>
			<div id="pageNav" class="pageNav">{$system_log->render()}</div>
		</article>
	</div>
</section>
</body>
<script type="text/javascript">
	// 一键删除
	function datadel()
	{
		obj = document.getElementsByName("amount_id");
	    check_val = [];
	    for(k in obj){
	        if(obj[k].checked)
	            check_val.push(obj[k].value);
	    }

	    if(check_val.length == 0) return layer.msg('您还未选择处理的数据');

	    layer.confirm('确认要一键删除吗？',function(index){
	    	var loading = layer.load(2, {
			  shade: [0.5,'#fff'] //0.1透明度的白色背景
			});

	    	$.post('/admin/System/del_log',{'id':JSON.stringify(check_val)},function(res){
				var _json = JSON.parse(res);
				if(_json.status == 1){
					layer.msg(_json.msg);
					setTimeout(function(){
						location.reload();
					}, 3000);
				}else{
					layer.msg(_json.msg);
				}
				layer.close(loading);
			})
		});

	}
</script>
</html>